<!-- 
1.下载axios npm i axios
2.在src新建utils文件夹,新建request.js文件
导入axios,暴露出去:
import axios from 'axios'
export default axios
3.在src新建api文件夹,新建index.js文件(写接口请求)
import request from '@/utils/request'

export const apitest = () =>{
    return request({
        url:"http://geek.itheima.net/v1_0/channels",
    })
}
4.在app.vue中加入
import {apitest} from "@/api/index"
export default{
    methods:{
        async btnClick(){
            const res = await apitest()
            colose.log(res)
        }
    }
}
 -->
